package com.efuture.druid;

import java.sql.Connection;
import java.sql.PreparedStatement;
/**
 * @ClassNAME DruidUtilsTest
 * @Description TODO
 * @Author Druid工具类测试 给db3库 account表添加一条数据
 * @Date 2021/9/20 9:00 下午
 * @Version 1.0
 */
public class DruidUtilsTest {

    public static void main(String[] args) {
        Connection conn = null;
        PreparedStatement pstmt = null;
        try{
            conn = DruidUtils.getConnection();
            String sql = "insert into account values(null,?,?)";
            pstmt = conn.prepareStatement(sql);
            pstmt.setString(1,"wangwu");
            pstmt.setDouble(2,3000);
            pstmt.executeUpdate();
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            DruidUtils.close(conn,pstmt);
        }


    }
}